package org.faradel.pharmapp.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.stereotype.Component;

/**
 * The persistent class for the PrescriptionOrder database table.
 * 
 */
@Entity
@Component("prescriptionOrder")
@Table(name = "PrescriptionOrder")
public class PrescriptionOrder implements Serializable
{
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "prescription_order_id")
    private int prescriptionOrderId;

    @Column(name = "cost")
    private BigDecimal cost;

    @Column(name = "last_modified")
    private Date lastModified;

    @Column(name = "price")
    private BigDecimal price;

    @Column(name = "quantity")
    private int quantity;

    @Column(name = "user_last_modified")
    private int userLastModified;

    // bi-directional many-to-one association to PatientOrder
    @ManyToOne
    @JoinColumn(name = "patient_order_id")
    private PatientOrder patientOrder;

    @ManyToOne
    @JoinColumn(name = "medication_id")
    private Medication medication;

    public PrescriptionOrder()
    {
    }

    public int getPrescriptionOrderId()
    {
        return this.prescriptionOrderId;
    }

    public void setPrescriptionOrderId(int prescriptionOrderId)
    {
        this.prescriptionOrderId = prescriptionOrderId;
    }

    public BigDecimal getCost()
    {
        return this.cost;
    }

    public void setCost(BigDecimal cost)
    {
        this.cost = cost;
    }

    public Date getLastModified()
    {
        return this.lastModified;
    }

    public void setLastModified(Date lastModified)
    {
        this.lastModified = lastModified;
    }

    public Medication getMedication()
    {
        return this.medication;
    }

    public void setMedication(Medication medication)
    {
        this.medication = medication;
    }

    public BigDecimal getPrice()
    {
        return this.price;
    }

    public void setPrice(BigDecimal price)
    {
        this.price = price;
    }

    public int getQuantity()
    {
        return this.quantity;
    }

    public void setQuantity(int quantity)
    {
        this.quantity = quantity;
    }

    public int getUserLastModified()
    {
        return this.userLastModified;
    }

    public void setUserLastModified(int userLastModified)
    {
        this.userLastModified = userLastModified;
    }

    public PatientOrder getPatientOrder()
    {
        return this.patientOrder;
    }

    public void setPatientOrder(PatientOrder patientOrder)
    {
        this.patientOrder = patientOrder;
    }

}